Sets, Logic, Computability

-An Open Logic Text

This textbook is about meta-logic, a discipline where the study is of logic itself. Formal Logic is concerned with studying valid inferences using formal languages and proof systems to express these inferences. Meta-logic investigates the properties of these languages and proof systems.

The goal of the textbook is to give a student who’s had a first class in logic the mathematical background to understand and prove results about formal languages.

It’s organized in 3 parts:


Set theory

Basic definitions for set theory.

Definition 1: A set is a well defined collection of objects, considered as an object itself. The objects making up the set are called elements or members of the set. There is no order to the elements and no multiplicity.

If a is an element of set X, then we write aXa \in X. And if not, we write aXa \notin X.

Sets are conventionally denoted with capital letters.

There is a set with no members, and it’s called the empty set, denoted by \emptyset.

There are two ways of describing a set.

We often have the choice of specifying a set either intensionally or extensionally. For example: R={xR = \{x : xx is one of the first four positive integers}\}. So T=RT = R

Definition 2: If XX and YY are sets, then they are identical. (Extensionality) The identity of sets are given by their extensions (the elements they contain). This definition gives us a common proof strategy for proving set identities.

Definition 3: If every element of XX is an element of YY, then XX is a subset of YY, symbolically XYX \subseteq Y.

Note that it follows from this definition that every set is a subset of itself.

Also, it’s possible for a set to be an element of another set.

If XYX \subseteq Y and Y̸XY \not\subseteq X then XYX \subset Y. In other words, if every element of XX is an element of YY, but not every element of YY is an element of XX, then we say that XX is a proper subset of YY.

Definition 4: The set consisting of all subsets of XX is called the power set of XX, written P(X)\mathscr{P} (X)

What are all the possible subsets of {a,b,c}\{a, b, c\}?

Definition 5: The union of XX and YY, written XYX \cup Y, is the set of all things which are elements of XX or YY or both.

XY={xX \cup Y = \{x : xXxY}x \in X \lor x \in Y\}

Venn diagrams can be useful to illustrate union and intersection.

Definition 6: The intersection of XX and YY, written XYX \cap Y, is the set of all things which are elements of both XX and YY.

Definition 7: If ZZ is a set of sets, then Z\bigcup Z is the set of elements of elements of ZZ.
Z={x\bigcup Z = \{x : xx belongs to an element of Z}Z\} or
Z={x\bigcup Z = \{x : there is a YZY \in Z such that xY}x \in Y\}

Definition 8: If ZZ is a set of sets, then Z\bigcap Z is the set of objects which all elements of ZZ have in common.
Z={x\bigcap Z = \{x : xx belongs to every element of Z}Z\} or
Z={x\bigcap Z = \{x : for all YZY \in Z, xY}x \in Y\}

Definition 9 The difference XYX \setminus Y is the set of all elements of XX which are not elements of YY.
XY={xX \setminus Y = \{x : xXx\in X and xY}x \notin Y\}


Ordered pairs, Tuples, and Cartesian Products

Sets have no order, but sometimes it is necessary to think of a collection in ordered terms. We use angle brackets to specify ordered pairs, such as x,y\langle x, y \rangle. Order matters so x,yy,x\langle x, y \rangle \neq \langle y, x \rangle.

Definition 10: Given sets XX and YY, their Cartesian product X×Y={x,yX \times Y = \{\langle x, y \rangle : xXx \in X and yY}y \in Y\}.

If X={0,1}X = \{0, 1\} and Y={1,a,b}Y = \{1, a, b\} what is X×YX \times Y?

Theorem 1 If XX has nn elements and YY has mm elements, then X×YX \times Y has nmn \cdot m elements.

Proof p. 10 (SLC)

Russell’s Paradox
In a village, the barber shaves everyone who does not shave themselves, and no one else.

The question that prompts the paradox is this: Does the barber shave himself?

1.3 Informal proof:
If XX has nn elements then P(X)\mathscr{P}(X) has 2^n elements.
Given an element xx of SS, each subset of SS either includes xx or does not include xx (by definition of set), which gives us two possibilities.
The same reasoning holds for any element of SS.
We can see that this means there are 2 * 2 * … * 2 = 2^|SS| total possible combinations of elements of SS.

We’ll come back to mathematical induction.